package com.yincheng.oes.business.base.entity;

import java.text.DecimalFormat;
import java.util.Date;

/**
 *
 * @author yangsy
 * @version 1.0.0
 * @since
 * 创建时间：2018年7月13日
 * 功能描述：题目信息实体
 * 邮箱地址：446948434@qq.com
 */
public class Question {
    /**
     * 主键id
     */
    private Integer id;

    /**
     * 题目编号
     */
    private String quesCode;

    /**
     * 题目类型，1:A1型题，2:A2型题，3:B型题，4:X型题
     */
    private String quesType;

    /**
     * 题干
     */
    private String stem;

    /**
     * 题目
     */
    private String question;

    /**
     * 关联关系，B型题特有
     */
    private String relationCode;

    /**
     * 选项A
     */
    private String optionA;

    /**
     * 选项B
     */
    private String optionB;

    /**
     * 选项C
     */
    private String optionC;

    /**
     * 选项D
     */
    private String optionD;

    /**
     * 选项E
     */
    private String optionE;

    /**
     * 选项F
     */
    private String optionF;

    /**
     * 答案
     */
    private String answer;

    /**
     * 答案解析
     */
    private String analysis;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 是否有效，0：无效，1：有效
     */
    private String valid;

    /**
     * 问题来源：1，书本；2，学生提问
     */
    private String quesSource;

    /**
     * 关联题目id
     */
    private Integer relationId;

    private String realQuestionYear;// 所属真题年代

    private String realQuestionNo;// 所属真题编号

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getQuesCode() {
        return quesCode;
    }

    public void setQuesCode(String quesCode) {
        this.quesCode = quesCode == null ? null : quesCode.trim();
    }

    public String getQuesType() {
        return quesType;
    }

    public void setQuesType(String quesType) {
        this.quesType = quesType == null ? null : quesType.trim();
    }

    public String getStem() {
        return stem;
    }

    public void setStem(String stem) {
        this.stem = stem == null ? null : stem.trim();
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question == null ? null : question.trim();
    }

    public String getRelationCode() {
        return relationCode;
    }

    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode == null ? null : relationCode.trim();
    }

    public String getOptionA() {
        return optionA;
    }

    public void setOptionA(String optionA) {
        this.optionA = optionA == null ? null : optionA.trim();
    }

    public String getOptionB() {
        return optionB;
    }

    public void setOptionB(String optionB) {
        this.optionB = optionB == null ? null : optionB.trim();
    }

    public String getOptionC() {
        return optionC;
    }

    public void setOptionC(String optionC) {
        this.optionC = optionC == null ? null : optionC.trim();
    }

    public String getOptionD() {
        return optionD;
    }

    public void setOptionD(String optionD) {
        this.optionD = optionD == null ? null : optionD.trim();
    }

    public String getOptionE() {
        return optionE;
    }

    public void setOptionE(String optionE) {
        this.optionE = optionE == null ? null : optionE.trim();
    }

    public String getOptionF() {
        return optionF;
    }

    public void setOptionF(String optionF) {
        this.optionF = optionF == null ? null : optionF.trim();
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer == null ? null : answer.trim();
    }

    public String getAnalysis() {
        return analysis;
    }

    public void setAnalysis(String analysis) {
        this.analysis = analysis == null ? null : analysis.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getValid() {
        return valid;
    }

    public void setValid(String valid) {
        this.valid = valid == null ? null : valid.trim();
    }

    /**
     * @return the quesSource
     */
    public String getQuesSource() {
        return quesSource;
    }

    /**
     * @param quesSource the quesSource to set
     */
    public void setQuesSource(String quesSource) {
        this.quesSource = quesSource;
    }

    /**
     * @return the relationId
     */
    public Integer getRelationId() {
        return relationId;
    }

    /**
     * @param relationId the relationId to set
     */
    public void setRelationId(Integer relationId) {
        this.relationId = relationId;
    }

    public String getRealQuestionYear() {
        return realQuestionYear;
    }

    public void setRealQuestionYear(String realQuestionYear) {
        this.realQuestionYear = realQuestionYear;
    }

    public String getRealQuestionNo() {
        if (realQuestionYear == null) {
            return null;
        }
        DecimalFormat df = new DecimalFormat("000");
        return df.format(Integer.parseInt(realQuestionNo));
    }

    public void setRealQuestionNo(String realQuestionNo) {
        this.realQuestionNo = realQuestionNo;
    }

    @Override
    public String toString() {
        return "Question [id=" + id + ", quesCode=" + quesCode + ", quesType=" + quesType + ", stem=" + stem
                + ", question=" + question + ", relationCode=" + relationCode + ", optionA=" + optionA + ", optionB="
                + optionB + ", optionC=" + optionC + ", optionD=" + optionD + ", optionE=" + optionE + ", optionF="
                + optionF + ", answer=" + answer + ", analysis=" + analysis + ", createTime=" + createTime + ", valid="
                + valid + ", quesSource=" + quesSource + ", relationId=" + relationId + ", realQuestionYear="
                + realQuestionYear + ", realQuestionNo=" + realQuestionNo + "]";
    }
}
